remove phrase field in Document model #148
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
remove phrase field in Document in favour of duplicating name during serialisation.
historically we've had two separate fields named
name
andphrase
which correspond to fields containing prefix grams and those which don't, respectively.the two fields contain exactly the same strings, and I've tried over the years to figure out a clean way of combining them into a single field, a trivial task but one which seems impossible to do without introducing breaking changes 😿
this PR makes a change to the
Document
model such that there aren't two copies of all the strings being passed around in memory and operated on.a quick look over the diff in this PR shows that we were doing a bunch of CPU work which was duplicatory and unnecessary, plus we're using up more memory storing all the strings twice 🤷♂️ .
@orangejulius could you please sanity check this for me?